<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no,minimal-ui">
    <meta name="format-detection" content="telephone=no">
    <title>我的</title>
    <link rel="stylesheet" href="/seller/css/style.css">
    <link rel="stylesheet" href="/seller/css/iconfont.css">
    <script src="/seller/js/flexible.js"></script>
    <script type="text/javascript" src="/js/jquery.min.js"></script>
</head>
<body>
<div class="views">
    <div class="shop_header">
        <div class="shop_logo"><img src="{Service_Attach::wxHeadImgUrl($data.avatar,132)}"></div>
        <div class="shop_title">{$data.shop_name}</div>
        <div class="shop_state">{if $data.shop_work_status eq 1}营业中{/if}{if $data.shop_work_status eq 2}打烊{/if}</div>
    </div>
    <div class="shop_option">
        <ul>
            <li><a {if $data.shop_work_status eq 2}onclick="workStatus({$data.shop_id},1)"{/if}><i class="icon iconfont">&#xe657;</i><span>营业中</span></a></li>
            <li><a {if $data.shop_work_status eq 1}onclick="workStatus({$data.shop_id},2)"{/if}><i class="icon iconfont">&#xe61d;</i><span>打烊</span></a></li>
        </ul>
    </div>
    <div class="shop_income">
        <ul>
            <li><a href="/user/fund"><i class="iconfont">&#xe675;</i><span>资金管理</span></a></li>
            <li><a href="/user/orderTj"><i class="iconfont">&#xe62c;</i><span>订单统计</span></a></li>
        </ul>
    </div>


    <div class="footer">
        <ul>
            <li><a href="/order/manager" ><i class="iconfont icon_one">&#xe606;</i><span>订单管理</span></a></li>
            <li><a href="/order/managerex"><i class="iconfont icon_two">&#xe600;</i><span>订单列表</span></a></li>
            <li><a href="/User/myCenter" class="ative"><i class="iconfont icon_four">&#xe603;</i><span>我的</span></a></li>
        </ul>
    </div>
</div>

<script type="text/javascript">
    function workStatus(id,status){
        $.ajax({
            type: 'post',
            url: '/User/modifyChainStatus',
            async: false,
            data: {
                id:id,
                status:status
            },
            success: function (data) {
                if (data.status == 200) {
                    //window.location.href = '/Index/userInfo?r=' + Math.random();
                    alert(data.success);
                    location.reload();
                } else {
                    alert('修改失败！'+data.error);
                }
            },
            error: function () {
                alert('编辑错误！');
            }
        })
    }
</script>

</body>
</html>